package com.example.summary.spring;

import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

/**
 * Created by wzn on 2019/1/16.
 */
@Service
public class MyFactoryBeanServiceImpl implements MyFactoryBeanService {

    public MyFactoryBeanServiceImpl() {
        System.out.println("构造函数");
    }

    @Autowired
    ApplicationContext applicationContext;

    @Override
    public String test() {
        return "1";
    }


//    public MyFactoryBean test(){
//        return applicationContext.getBean(MyFactoryBean.class);
//    }


//    @Override
//    public void setBeanName(String s) {
//        System.out.println("BeanNameAware||" + s);
//    }
//
//
//    @Override
//    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
//        System.out.println("BeanFactoryAware");
//        beanFactory.getBean(MyFactoryBean.class);
//    }
//
//    @Override
//    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
//        System.out.println("ApplicationContextAware");
//    }
//
//
//    @Override
//    public void afterPropertiesSet() throws Exception {
//        System.out.println("InitializingBean");
//        System.out.println(name);
//    }
//
////    public void initMethod() {
////        System.out.println("调用initMethod方法");
////    }
//
//    @Override
//    public void destroy() throws Exception {
//        System.out.println("DisposableBean");
//    }

    /**
     * destroy-method
     */
}
